﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MainWeb.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="LangMauViet.Classes.Helper" %>
<%@ Import Namespace="LangMauViet.Models.Entity" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Langmauviet.vn - Tin tức
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

 <% var listNewsNoibat = (List<News>)ViewData["listNewsNoibat"];
    var vlistNewsNewWeb = (List<News>)ViewData["vlistNewsNewWeb"];
       var vlistNewsXemNhieu = (List<News>)ViewData["vlistNewsXemNhieu"];
       var lNews = (List<News>)ViewData["listNewsWeb"];
       var nlistHotWeb = (List<News>) ViewData["nlistHotWeb"];
       int totalRecord = ViewBag.totalRecordWeb;
       int totalPage = totalRecord % 24 == 0 ? totalRecord / 24 : totalRecord / 24 + 1;
       int hotpage = ViewBag.hotpage;
    %>
    <div class="container row-fluid">
        <div id="main-content">
            <div class="box box-feature">
                <div class="box-content box-clip">
                    <div class="vlist clearfix">
                        <div class="vhome-feature">
                            <div class="vhome-top-feature vextra">
                                   <% if (!ReferenceEquals(vlistNewsNewWeb, null))
                                      {
                                          News v = vlistNewsNewWeb.ElementAt(0);
                                   %>
                                     <a title ="<%= v.Title %>" href="/Tin-tuc/Chi-tiet/<%= v.NewsId %>/<%= UIHelper.convertToUnSign(v.Title) %>" class="vlink">
                                    <div class="vthumb">
                                        <img alt="<%= v.Title %>" src="http://vipmobi.net:7001/mobile/download?v=1&w=250&id=<%= v.Icon %>">
                                    </div>
                                    <h3 class="max-line-2">
                                        <%= v.Title%></h3>
                                </a>
                                <% 
                               }
                                %>
                            </div>
                            <div class="vhome-recent">
                                <p class="title">
                                    Xem nhiều</p>
                                <div class="nano has-scrollbar">
                                    <div class="sliderContent" tabindex="0" style="right: -17px;">
                                        <div class="vlist-single">
                                            <ul>
                                                 <% if (!ReferenceEquals(vlistNewsXemNhieu, null))
                                                    {
                                                        foreach (News v in vlistNewsXemNhieu)
                                                        { %>
                                                          <li>
                                                              
                                                              <a title="<%= v.Title %>" href="/Tin-tuc/Chi-tiet/<%= v.NewsId %>/<%= UIHelper.convertToUnSign(v.Title) %>">
                                                    <%= v.Title %></a>
                                                          </li>

                   <% }
                                                    } %>
                                              
                                               
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="pane" style="opacity: 1; visibility: visible;">
                                        <div class="slider" style="height: 71px; top: 0px;">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="vhome-feature-alternative">
                            <ul class="vvertical">
                                   <% if (!ReferenceEquals(vlistNewsNewWeb, null))
                                      {
                                          for (int i = 1; i < vlistNewsNewWeb.Count; i++)
                                          {
                                              News v = vlistNewsNewWeb.ElementAt(i);
                                   %>
                                               
                                                      <li class="vitem vsmall">
                                                          <a title="  <%= v.Title %>" href="/Tin-tuc/Chi-tiet/<%= v.NewsId %>/<%= UIHelper.convertToUnSign(v.Title) %>"
                                                            class="vlink">
                                                            <div class="vthumb">
                                                                <img alt="  <%= v.Title %>" src="http://vipmobi.net:7001/mobile/download?v=1&w=250&id=<%= v.Icon %>">
                                                              <%--  <span class="vticker">07:45</span> <span class="watch-later _watch_later " title="Đánh dấu chờ xem lại"
                                                                    data-cid="1726875"><i class="icon-time"></i></span>--%>
                                                            </div>
                                                            <h4>
                                                                  <%= v.Title%></h4>
                                                        </a>
                                                      </li>
                                           <% }
                                      } %>
                              
                             
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="box clearfix">
                <div class="box-header">
                    <div class="box-tab row-fluid">
                        <ul>
                            <li><a title="Tin tức" href="/">Tin Hot</a></li>
                          
                        </ul>
                    </div>
                </div>
                <div class="box-content box-clip">
                    <div class="vlist">
                        <div class="vlist-inner clearfix" id="boxlistnews">
                            <ul class="clearfix">
                                 <% if (!ReferenceEquals(nlistHotWeb, null))
                                    {
                                        int j = 2;                                   
                                        for (int i = 0; i < nlistHotWeb.Count; i++)
                                        {
                                            News newse = nlistHotWeb.ElementAt(i);
                                         %>
                                         <% if (i==j)
                                            {
                                                j += 3;
                                         %>
                                         <li class="vitem vlarge last"> 
                                             <% }
                                            else
                                            { %>
                                             <li class="vitem vlarge">
                                             <% } %>
            
                                             <a title="<%= newse.Title %>"
                                    href="/Tin-tuc/Chi-tiet/<%= newse.NewsId %>/<%= UIHelper.convertToUnSign(newse.Title) %>"
                                    class="vlink">
                                    <div class="vthumb">
                                          <img alt="<%= newse.Title %>" src="http://vipmobi.net:7001/mobile/download?v=1&w=500&h=500&id=<%= newse.Icon %>">
                                      <!--  <span class="vticker">02:21</span> --> <span class="watch-later _watch_later " title="Đánh dấu chờ xem lại"
                                            data-cid="1726768"><i class="icon-time"></i></span>
                                    </div>
                                    <h4 class="max-line-2">
                                        <%= newse.Title %></h4>
                                </a>
                                         </li>
                       <% }
                                    } %>
                               
                             
                            </ul>
                        </div>
                    </div>
                    <div class="clip-viewmore clear" id="newsviewmore">
                        <input type="hidden" value="1" id="pager"/>
                        <a class="viewmore-btn btn btn-small _viewmore_btn" href="javascript:" onclick="ShowMoreNews();"><span class="text">
                            Xem thêm</span> <span class="img expand"></span></a>
                    </div>
                </div>
               
            </div>
     
        </div>
        <div id="sidebar">
            <!-- Start ads right_banner1-->
            <div class="box clearfix">
                <div class="box-header">
                    <h3>
                        Tin nổi bật</h3>
                </div>
                <div class="box-content box-clip box-left">
                    <div class="vlist vrecent vscroll clearfix">
                        <ul>
                            <% if (!ReferenceEquals(listNewsNoibat, null))
                               {
                                   foreach (News v in listNewsNoibat)
                                   { %>
                            <li class="vitem vsmall vvertical"><a class="vlink" href="/Tin-tuc/Chi-tiet/<%= v.NewsId %>/<%= UIHelper.convertToUnSign(v.Title) %>"
                                title="<%= v.Title %>">
                                <div class="vthumb">
                                    <img src="http://vipmobi.net:7001/mobile/download?v=1&w=250&id=<%= v.Icon %>">
                                    <!--   <span class="vticker">15 clip</span> -->
                                </div>
                                <h4>
                                    <%= v.Title%></h4>
                            </a></li>
                            <% }
                         }
                            %>
                        </ul>
                    </div>
                </div>
            </div>
            <!-- End ads right_banner1-->
            <!-- Start ads right_banner2-->
            <!-- End ads right_banner2-->
            <!-- Start ads box_widget-->
            <!-- End ads right_banner2-->
        <%--    <div class="box box-fb">
                <div class="inner">
                    <div class="box-content">
                        <div class="in2">
                            <div class="frame-fb">
                                <div class="fb-like-box fb_iframe_widget" data-href="http://www.facebook.com/clipvn"
                                    data-width="292" data-show-faces="true" data-stream="false" data-header="false"
                                    data-border-color="#EDEFF4" fb-xfbml-state="rendered" fb-iframe-plugin-query="app_id=203969326372034&amp;header=false&amp;href=http%3A%2F%2Fwww.facebook.com%2Fclipvn&amp;locale=vi_VN&amp;sdk=joey&amp;show_faces=true&amp;stream=false&amp;width=292">
                                    <span style="vertical-align: bottom; width: 292px; height: 241px;">
                                        <iframe name="f403340c8" width="292px" height="1000px" frameborder="0" allowtransparency="true"
                                            scrolling="no" title="fb:like_box Facebook Social Plugin" src="../Home/langmauviet.vn - Mạng chia sẻ video lớn nhất Việt Nam_files/like_box.htm"
                                            class="" style="border: none; visibility: visible; width: 292px; height: 241px;">
                                        </iframe>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>--%>
          
            <!-- Start ads box_widget-->
            <!-- End ads box_widget-->
        </div>
        <!--- Ads by Ambient Digital --->
        <%--<script type="text/javascript">
            var _abd = _abd || [];
            /* load placement for account: clip, site: http://langmauviet.vn, size: 1x1 - web, zone: popup */
            _abd.push(["1291026492", "Popup", "1347855553"]);
</script>
        <script src="../Home/langmauviet.vn - Mạng chia sẻ video lớn nhất Việt Nam_files/adnetwork.js"
            type="text/javascript"></script>
        <script type="text/javascript" src="../Home/langmauviet.vn - Mạng chia sẻ video lớn nhất Việt Nam_files/saved_resource"></script>
        <noscript>
            &lt;a href="http://track.adnetwork.vn/247/adServerNs/zid_1347855553/wid_1291026492/"
            target="_blank"&gt;&lt;img src="http://delivery.adnetwork.vn/247/noscript/zid_1347855553/wid_1291026492/"
            /&gt;&lt;/a&gt;</noscript>--%>
        <!--- Ads by Ambient Digital --->
    </div>
    <script type="text/javascript">
        function ShowMoreNews() {
            $('#pager').val(parseInt($('#pager').val()) +1);
            var x = $('#pager').val();
           
            $.ajax({
                url: '/Category/NewsLoadMore',
                data: {
                    hotpage: x
                },
                method: 'Get',
                success: function (data) {
                    $('#boxlistnews').append(data);
                    
                    if (parseInt(x) == <%=totalPage %>) {
                        $('#newsviewmore').hide();
                    }
                }
            });
        }
    </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="metaheader" runat="server">
</asp:Content>
